/***************************************************************************
 *   Copyright (C) 2009 by Rysiek Król,,,   				   *
 *   rysiek.krol@gmail.com   						   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include "fileoperationerrorevent.h"


/**
 * Class Constructor
 * @param typ - typ of the operation
 * @param fileName - file name
 */
FileOperationErrorEvent::FileOperationErrorEvent(FileOperationsHandler *handler, FileOperationsHandler::OperationType typ, QString fileName)
        : ViewerEvent(ViewerEvent::FileOperationError),handler(handler), typ(typ), fileName(fileName)
{
}

/**
 * Class destructor
 */
FileOperationErrorEvent::~FileOperationErrorEvent()
{

}

/**
 * Returns file name
 * @return
 */
QString FileOperationErrorEvent::getFileName() const
{
    return fileName;
}

/**
 * Returns Operation Type
 * @return
 */
FileOperationsHandler::OperationType FileOperationErrorEvent::getOperationType() const
{
    return typ;
}

/**
 * Returns cause of the error
 * @return 
 */
FileOperationsHandler::ErrorCause FileOperationErrorEvent::getCause() const
{
    return cause;
}

/**
 * Returns true, if many files are selected.
 * @return
 */
bool FileOperationErrorEvent::getManyFiles()
{
    return this->manyFiles;
}

/**
 * Sets the cause of the error
 *
 */
void FileOperationErrorEvent::setCause(FileOperationsHandler::ErrorCause cause){
        this->cause = cause;
}

/**
 * Sets, if many files are selected
 *
 */
void FileOperationErrorEvent::setManyFiles(bool manyFiles){
    this->manyFiles = manyFiles;
}

/**
 * Returns handler to this operation
 */
FileOperationsHandler * FileOperationErrorEvent::getHandler(){
    return this->handler;
}

